package cn.iocoder.yudao.module.shop.dal.mysql.itemtimes;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.shop.dal.dataobject.itemtimes.ShopItemTimesDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.shop.controller.admin.itemtimes.vo.*;

/**
 * 店内项目次数 Mapper
 *
 * @author 曹建伟
 */
@Mapper
public interface ShopItemTimesMapper extends BaseMapperX<ShopItemTimesDO> {

    default PageResult<ShopItemTimesDO> selectPage(ShopItemTimesPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ShopItemTimesDO>()
                .eqIfPresent(ShopItemTimesDO::getMemberId, reqVO.getMemberId())
                .betweenIfPresent(ShopItemTimesDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ShopItemTimesDO::getId));
    }

    default List<ShopItemTimesDO> selectList(ShopItemTimesExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<ShopItemTimesDO>()
                .eqIfPresent(ShopItemTimesDO::getMemberId, reqVO.getMemberId())
                .betweenIfPresent(ShopItemTimesDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ShopItemTimesDO::getId));
    }

}
